package assign4;


/** Launches servers and networks them together
 */
public class DBServerCreator
{	
	static int serverCount = Globals.numOfServers;
	static String masterServerUri = Globals.serverNamePrefix + Globals.masterServerName;
	
	public static void main(String[] args)
	{
		for(int i=0; i<serverCount; ++i)
		{
			spawnServer("Server" + i, masterServerUri);
		}
	}
	
	private static void spawnServer(String serverName, String masterServerName)
	{
		try
		{
			new ReplicatedDBServer(serverName, masterServerName);
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}